//
//  AliMNSTopic.h
//  AlibabaCloudMNSiOS
//
//  Created by David Chen on 28/03/2017.
//  Copyright © 2017 AliCloud. All rights reserved.
//
#import "AliMNSClient.h"
#import "AliMNSTopicMeta.h"

@interface AliMNSTopic : NSObject
@property NSString* topicName;
@property AliMNSClient* mMNSClient;

-(id) initWithTopicName:(NSString*) pTopicName
          withMNSClient:(AliMNSClient*) pMNSClient;

-(NSString*) create:(AliMNSTopicMeta*) topicMeta;

-(void) deleteTopic;

-(void) setTopicAttributes:(AliMNSTopicMeta*) topicMeta;

-(AliMNSTopicMeta*) getTopicAttributes;

-(AliMNSTopicMessage*) publishMessage:(AliMNSTopicMessage*) message;

-(void) asyncPublishMessage:(AliMNSTopicMessage*) message
         withSuccessHandler:(void (^)(AliMNSTopicMessage* msg)) successHandler
            withFailHandler:(void (^)(AliMNSError* err)) failHandler;

-(NSString*) subscribe:(AliMNSSubscription*) subscription;

-(void) unsubscribe:(AliMNSSubscription*)subscription;

-(NSArray*) listSubscription:(NSString*) prefix
            withReturnNumber:(NSInteger)returnNumber
                withMarker:(NSString**) Marker;

-(void) setSubscriptionAttributes:(AliMNSSubscription*) sub;

-(AliMNSSubscription*) getSubscriptionAttributes:(NSString*) subName;

@end
